package com.sky.mapper;

import com.sky.entity.DishFlavor;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface SetmealDishMapper {

    @Insert("Insert into setmeal_dish (dish_Id, name, price, copies, setmeal_Id) " +
            "values (#{dishId}, #{name}, #{price}, #{copies}, #{setmealId})")
    void saveSetmealDish(SetmealDish setmealDish);

    @Select(" select * from setmeal_dish where setmeal_Id =#{id} ")
    List<SetmealDish> getSetmealDish(Long id);

    //删除 根据dish_Id 删除
    @Delete(" delete from setmeal_dish where setmeal_Id = #{id} ")
    void deletById(Long id);

    @Select("select * from setmeal_dish")
    List<SetmealDish> selectAll();


}
